package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:lenovo
 * Date:2024-05-21
 * Time:15:10
 */
/*      (1)定义客户信息user:name=“XiaoMing”,pid=12345678.
        (2)定义2个账户:
            a1:id=12345,balance=1000 a2:id=67890，balance=3000
        (3)将a1和a2依次加入user 的账户列表。
        (4)调用transfer方法实现由al 账户向a2 账户转账 500 元。*/
public class Test {
    public static void main(String[] args) {
        UserInfo p=new UserInfo("XiaoMing",12345678);

        Account a1=new Account(12345,1000);
        Account a2=new Account(67890,3000);

        p.addAccount(a1);
        p.addAccount(a2);
        //a1存在了accounts[0]
        //a2存在了accounts[1]

        p.transfer(0,1,500);

        p.displayAccountBalances();
    }
}
